﻿@{
    Layout = "~/Views/Shared/OA/_Index.cshtml";
}
@section Toolbar
{
    @if (!string.IsNullOrEmpty(Request["RoleId"]))
    {
        @Html.MyNet().Button(new ButtonOptions { Text = "返回", Click = "back" })
    }
    @Html.MyNet().Button(new ButtonOptions { Text = "查看详情", Click = "detail" })
}
@section Menu
{
    @Html.MyNet().Menu(new ButtonOptions { Text = "查看详情", Click = "detail" })
}
@section Query
{
    @Html.Partial("_Query", new UserCondition())
}
@section Main
{
    <div id="grid" class="grid">
    </div>
    <div id="pager" class="pager">
    </div>
}
@Html.Hidden("ForApplication", Request["Application"])
@Html.Hidden("RoleId", Request["RoleId"])

<script>

    var application = "MK";
    var roleId ="App_User";

    var url = "/Common/User/";

    jQuery(function () {
        read();
    });

    function read() {
        query.application = application;
        query.roleId = roleId;
        $.ajax
        ({
            url: url + "Read?VView=ReadForMK",
            data: query,
            type: "post",
            error: disposeError,
            success: function (result) {
                if (disposeException(result)) return;
                bind(result);
            }
        });
    }

    function detail() {
        if (!gridSelected()) return alert("未选中任何数据！");
        nav(url + "Detail?Id=" + gridSelected()[0] + "&Application=" + application);
    }
   
</script>
